using System;
using Gtk;

public partial class MainWindow : Gtk.Window
{
	public MainWindow () : base(Gtk.WindowType.Toplevel)
	{
		Build ();
	}

	protected void OnDeleteEvent (object sender, DeleteEventArgs a)
	{
		Application.Quit ();
		a.RetVal = true;
	}
	
	float operar = new float(); 
	
	protected virtual void OnNumeroClicked (object sender, System.EventArgs e)
	{
		muestra.Text= muestra.Text + numero.Label;
	}
	
	protected virtual void OnNumero1Clicked (object sender, System.EventArgs e)
	{
		muestra.Text= muestra.Text + numero1.Label;
	}
	
	protected virtual void OnNumero2Clicked (object sender, System.EventArgs e)
	{
		muestra.Text= muestra.Text + numero2.Label;
	}
	
	protected virtual void OnNumero3Clicked (object sender, System.EventArgs e)
	{
		muestra.Text= muestra.Text + numero3.Label;
	}
	
	protected virtual void OnNumero4Clicked (object sender, System.EventArgs e)
	{
		muestra.Text= muestra.Text + numero4.Label;
	}
	
	protected virtual void OnNumero5Clicked (object sender, System.EventArgs e)
	{
		muestra.Text= muestra.Text + numero5.Label;
	}
	
	protected virtual void OnNumero6Clicked (object sender, System.EventArgs e)
	{
		muestra.Text= muestra.Text + numero6.Label;
	}
	
	protected virtual void OnNumero7Clicked (object sender, System.EventArgs e)
	{
		muestra.Text= muestra.Text + numero7.Label;
	}
	
	protected virtual void OnNumero8Clicked (object sender, System.EventArgs e)
	{
		muestra.Text= muestra.Text + numero8.Label;
	}
	
	protected virtual void OnNumero9Clicked (object sender, System.EventArgs e)
	{
		muestra.Text= muestra.Text + numero9.Label;
	}
	protected virtual void OnSumarClicked (object sender, System.EventArgs e)
	{
		operar = 0;
		operar += float.Parse(muestra.Text);
		muestra.Text = "";
		muestra.Text = operar.ToString();
	}
	
	protected virtual void OnRestarClicked (object sender, System.EventArgs e)
	{
		operar = 0;
		operar -= float.Parse(muestra.Text);
		muestra.Text = "";
		muestra.Text = operar.ToString();
		
	}
	
	protected virtual void OnMultiplicarClicked (object sender, System.EventArgs e)
	{
		operar = 0;
		operar *= float.Parse(muestra.Text);
		muestra.Text = "";
		muestra.Text = operar.ToString();

	}
	
	protected virtual void OnDividirClicked (object sender, System.EventArgs e)
	{
		operar = 0;
		operar = operar / float.Parse(muestra.Text);
		muestra.Text = operar.ToString();
	}
	
	protected virtual void OnResetClicked (object sender, System.EventArgs e)
	{
		operar = 0;
		muestra.Text = "";
	}
	protected virtual void OnTotal1Clicked (object sender, System.EventArgs e)
	{
		operar = 0;
		muestra.Text = "";
	}
}
